package connection;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleDriver;


public class ConnectionBD{

        public String url = "jdbc:oracle:thin:@localhost:1521:XE";
    public String user = "SYSDBA";
    public String pass = "1234";
    static Connection conexao;
 
	    
    public ConnectionBD(){
		try   {
		    Class.forName(OracleDriver.class.getName());
			this.conexao = //DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "system", "oracle");//
                                DriverManager.getConnection(url, user, pass);
        } catch(Exception e) {
			System.out.println("ERRO ao Acessar: "+e.toString());
		}

	}

   	public static Connection getInstance(){
		if(conexao == null){
			new ConnectionBD();
		}
		return conexao;
	}
}